package com.chess.annotation.demo;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class AnnotationBoundView extends View {

	private Paint paint = new Paint();

	public AnnotationBoundView(Context context) {

		this(context, null);

	}

	public AnnotationBoundView(Context context, AttributeSet attr) {
		this(context, attr, 0);
	}

	public AnnotationBoundView(Context context, AttributeSet attr, int defaultStyle) {
		super(context, attr, defaultStyle);
		init();
	}

	private void init() {
		paint.setColor(android.graphics.Color.BLUE);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);

		canvas.drawLine(0, 0, this.getWidth() - 1, 0, paint);
		canvas.drawLine(0, 0, 0, this.getHeight() - 1, paint);
		canvas.drawLine(this.getWidth() - 1, 0, this.getWidth() - 1, this.getHeight() - 1, paint);
		canvas.drawLine(0, this.getHeight() - 1, this.getWidth() - 1, this.getHeight() - 1, paint);
	}

}